{% extends "Common/AdminBase.html" %}
{% load filters %} 
{% block Location %}

<li class="current" ><a href='/AdminMain/Article/Index/'>文章列表</a></li>
<li>/</li>
<li class="current">软件下载发布</li>


{% endblock %}


{% block content %}

<link rel="stylesheet" href="/site_media/admin/kindeditor/themes/default/default.css" />
<script charset="utf-8" src="/site_media/admin/kindeditor/kindeditor-min.js"></script>
<script charset="utf-8" src="/site_media/admin/kindeditor/lang/zh_CN.js"></script>
<script type='text/javascript' src='/site_media/admin/My97DatePicker/WdatePicker.js'></script>

<div class="contentcontainer">
	
	<form action="#" AjaxForm="/AdminMain/Article/DoAddSoft/" Ajaxverify="$.AjaxFormVerify"    AjaxSuccess="onRefresh">
		<input type="hidden" id="KeyId" name="KeyId" value="{{Model.ContentId}}">
            {% include 'AdminMain/Article/ContentBase.html' %}
     <br/>
	      <div class="headings alt">
                <h2>扩展信息</h2>
            </div>
            <div class="contentbox">
            	
				  <div style="width:100%;float:left">
					<p style="float:left;width:350px">
                        <label for="textfield"><strong>软件名称</strong></label>
                        <input id="Title" maxlength="20"  name="Title" type="text"  class="inputbox"> 
						<br>
                    </p>
                   
					<p style="float:left;">
                        <label  for="textfield"><strong>软件大小（KB）</strong></label>
                        <input id="SoftSize" maxlength="20"  name="SoftSize" type="text" vf_Num="SoftSize"  value="0" maxlength="100" class="inputbox"> 
						<span  vf_span="SoftSize"  class="smltxt red"></span>
						<br>
                    </p>
				</div>
				
				 <div style="width:100%;float:left">
					<p style="float:left;width:350px">
                        <label for="textfield"><strong>版本号</strong></label>
                        <input id="Version" maxlength="20"  name="Version" type="text"   class="inputbox"> 
						<br>
                    </p>
                   
					<p style="float:left;">
                        <label  for="textfield"><strong>开发商</strong></label>
                        <input id="Developers" maxlength="50"  name="Developers" type="text"  class="inputbox"> 
						<br>
                    </p>
				</div>
				
				<div style="width:100%;float:left">
					<p style="float:left;width:350px">
                        <label for="textfield"><strong>开发商网站</strong></label>
                        <input id="DevelopersWeb" maxlength="200"  name="DevelopersWeb" type="text"   class="inputbox"> 
						<br>
                    </p>
					
					<p style="float:left;">
                        <label  for="textfield"><strong>语言</strong></label>
                        <input id="Language" maxlength="50"  name="Language" type="text"  class="inputbox"> 
						<br>
                    </p>
				</div>
				
				
				<div style="width:100%;float:left">
					<p style="float:left;width:350px">
                        <label for="textfield"><strong>运行环境</strong></label>
                        <input id="OperatingEnvironment" maxlength="50"  name="OperatingEnvironment" type="text"   class="inputbox"> 
						<br>
                    </p>
				</div>
				
				<div style="width:100%;float:left">
					<p style="float:left;">
                        <label for="textfield"><strong>软件介绍</strong></label>
						<textarea class="inputbox" alt="软件介绍" name="Explain" v_maxlength="500"  rows="5" cols="150" style="margin-left: 0px; margin-right: 0px; width: 651px; " ></textarea>
						<span  vf_span="Explain"  class="smltxt red"></span>
						
						<br>
                    </p>
				</div>
				<div style="width:100%;float:left">
					<p style="float:left;">
                        <label for="textfield"><strong>软件截图</strong></label>
						
						<input class="ke-input-text" type="hidden" id="FileImageId" name="FileImageId"  /> <input type="button" id="uploadImgFileImage" value="上传" />
						<br>
						<img id="ImgFileImageId" > </img>
						<br>
                    </p>
				    </div>
					
					<div style="width:100%;float:left">
					<p style="float:left;">
                        <label for="textfield"><strong>上传软件</strong></label>
						
						<input class="ke-input-text" type="hidden" id="FileId" name="FileId"  /> <input type="button" id="uploadImgFileId" value="上传" />
						<br>
						
						<input vf_NotNull alt="上传软件" id="txtFileId" readonly="true" type="text"   class="inputbox"> 
						<span   vf_span="txtFileId"  class="smltxt red"></span>
						<br>
                    </p>
				    </div>
				
				
				
				
				<div style="width:100%;float:left">
					<p style="float:left;">
							 <input type="submit"  value="发表" onclick="saveOut()" class="btn" > 
							 <input type="submit"  value="发表并继续" onclick="saveIn()" class="btn" >
							 <input type="submit"  value="保存到草稿" onclick="savecg()" class="btn" >
                    </p>
				</div>
				<input type="hidden" name="State" id="State" value="1">
	   </div>
	   
	 </form>
        </div>
		

<script>
	var outlocd="";
	
function saveOut()
{
	$("#State").val("1");
	outlocd="/AdminMain/Article/Index/"
}

function saveIn()
{
	$("#State").val("1");
	outlocd=window.location;
}

function savecg()
{
	$("#State").val("3");
	outlocd="/AdminMain/Article/Index/"
}

function OnChange()
{
	
}


KindEditor.ready(function(K) {
				var uploadbutton = K.uploadbutton({
					button : K('#uploadImgFileId')[0],
					fieldName : 'imgFile',
					url : '/AdminMain/SysFile/UpFile/?ModelId={{Model.info.ContentId}}',
					afterUpload : function(data) {
						if (data.error === 0) {
							var url = K.formatUrl(data.url, 'absolute');
							K('#FileId').val(data.id);
							$('#txtFileId').val(url);
						} else {
							alert(data.message);
						}
					},
					afterError : function(str) {
						alert('自定义错误信息: ' + str);
					}
				});
				uploadbutton.fileBox.change(function(e) {
					uploadbutton.submit();
				});

			});

KindEditor.ready(function(K) {
				var uploadbutton = K.uploadbutton({
					button : K('#uploadImgFileImage')[0],
					fieldName : 'imgFile',
					url : '/AdminMain/SysFile/UpFile/?ModelId={{Model.info.ContentId}}',
					afterUpload : function(data) {
						if (data.error === 0) {
							var url = K.formatUrl(data.url, 'absolute');
							K('#FileImageId').val(data.id);
							$('#ImgFileId').attr("src",url);
							$('#ImgFileId').attr("width",300);
							$('#ImgFileId').attr("height",200);
						} else {
							alert(data.message);
						}
					},
					afterError : function(str) {
						alert('自定义错误信息: ' + str);
					}
				});
				uploadbutton.fileBox.change(function(e) {
					uploadbutton.submit();
				});

			});


function onRefresh(obj)
{
	$.tips(obj.ErrorTxt);
	window.location=outlocd;
}
</script>
          
    
		
{% endblock %}

